package com.czxy.service;

import com.czxy.dao.WordMapper;
import com.czxy.domain.Words;
import com.czxy.utils.MyBatisUtils;
import org.junit.Test;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

public class WordService {


    public List<Words> getWord(String word){

        WordMapper mapper = MyBatisUtils.getMapper(WordMapper.class);
        Example example = new Example(Words.class);
        Example.Criteria ct = example.createCriteria();

        ct.andLike("word","%"+word+"%");


        List<Words> words = mapper.selectByExample(example);

        return words;


    }


   @Test
    public  void test01(){


        WordService Service = new WordService();

        List<Words> list = Service.getWord("a");

        System.out.println(list);

    }
}
